<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-sned-edit" >
		<input id="id" name="id"th:value="${sned.id}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label">作业要求：</label>
				<button class="btn btn-primary  btn-xs" onclick="lookdesc()" type="button">查看题目要求</button>
				<div class="col-sm-12">
					<div id="description"></div>
				</div>
			</div>
			<div class="form-group" style="overflow:auto">
				<label class="col-sm-3 control-label">作业内容：</label>
				<div class="col-sm-12">
					<div th:utext="${sned.content}"></div>
				</div>
			</div>
			<div class="form-group">
			<label class="col-sm-3 control-label">成绩：</label>
			<div class="col-sm-12">
				<input id="score" name="score" th:value="${sned.score}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">审核结果：</label>
			<div class="col-sm-12">
				<input id="comment" name="comment" th:value="${sned.comment}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">是否允许补交（默认off不允许）：</label>
			<div class="col-sm-8">
				<div class="onoffswitch">
					<input type="checkbox" th:checked="${sned.isrejob == 1 ? true : false}" class="onoffswitch-checkbox" id="isrejob" name="isrejob">
					<label class="onoffswitch-label" for="isrejob">
						<span class="onoffswitch-switch"></span>
						<span class="onoffswitch-inner"></span>
					</label>
				</div>
			</div>
		</div>
		</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
	var prefix = ctx + "job/sned";
	var snid="[[${sned.snid}]]";
	$("#form-sned-edit").validate({
		onkeyup: false,
		rules:{
			score:{
				required:true,
				digits:true,
				range:[0,100]
			},
		}
	});
	function lookdesc(){
		$.ajax({
			url: ctx+"job/jobpub/onePub",
	        type: "post",
	        dataType: "json",
	        data: {"id":snid},
	        beforeSend: function () {
	        	$.modal.loading("正在处理中，请稍后...");
	        },
	        success: function(result) {
	        	$("#description").html(result.description);
	        	$.modal.closeLoading();
	        }
		})

	}
	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit3", $('#form-sned-edit').serialize());
		}
	}
</script>
</body>
</html>
